import request from '@/utils/request'
/** *
 *
 * 获取组织架构数据
 * **/
export function getDepartments() {
    return request({
        url: '/company/department'

    })
}

export function delDedpartment(id) {
    return request({
        url: `/company/department/${id}`,
        method: 'delete'
    })
}
/**
 * 新增部门
 * @param {Object} data 
 * @returns 
 */
export function addDepartments(data) {
    return request({
        url: '/company/department',
        method: 'post',
        data
    })
}

export function getDepartDetail(id) {
    return request({
        url: `/company/department/${id}`
    })
}
/**
 * 编辑部门
 *
 * ***/
export function updateDepartments(data) {
    return request({
        url: `/company/department/${data.id}`,
        method: 'put',
        data
    })
}